import request from '../../utils/request'

export function requestLogin (params) {
    return new Promise(resolve => {
        request.post('/admin/login', params).then(res => {
            resolve(res.data)
        })
    })
}

export function requestGetUserlist () {
    return new Promise(resolve => {
        request.get('/user/list').then(res => {
            resolve(res.data)
        })
    })
}

export function requestModifyUserlist (id, data) {
    return new Promise(resolve => {
        request.post('/user/modify', {
            id,
            data
        }).then(res => {
            resolve(res.data)
        })
    })
}

export function requestRemoveUserlist(id){
    return new Promise(resolve => {
        request.post('/user/delete', {
            id,
        }).then(res => {
            resolve(res.data)
        })
    })
}
